home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Jotto ][ 1.2 / source / Wipes ƒ / Skipaline U-D.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  1.2 KB  |  37 lines  |  [TEXT/MMCC]

  1. #include "timing.h"
  2.  
  3. #define CorrectTime 1
  4. #define theWindowWidth (boundsRect.right-boundsRect.left)
  5. #define theWindowHeight (boundsRect.bottom-boundsRect.top)
  6.  
  7. pascal short Skipaline(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect);
  8.  
  9. /* Copy even-numbered rows starting at the top and moving down, and copy odd-
  10.    numbered rows starting at the bottom and moving up. */
  11.    
  12. pascal short Skipaline(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect)
  13. {
  14.     Rect        thisone,thatone;
  15.     
  16.     SetRect(&thisone, boundsRect.left, boundsRect.top, boundsRect.right, boundsRect.top+1);
  17.     SetRect(&thatone, boundsRect.left, boundsRect.bottom-1, boundsRect.right, boundsRect.bottom);
  18.     if (theWindowHeight%2)
  19.         OffsetRect(&thatone, 0, -1);
  20.     
  21.     while (thisone.top<boundsRect.bottom)
  22.     {
  23.         StartTiming();
  24.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  25.             &thisone, &thisone, 0, 0L);
  26.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  27.             &thatone, &thatone, 0, 0L);
  28.         thisone.top+=2;             /* even row goes down by 2 */
  29.         thisone.bottom+=2;
  30.         thatone.top-=2;             /* odd row goes up by 2 */
  31.         thatone.bottom-=2;
  32.         TimeCorrection(CorrectTime);
  33.     }
  34.     
  35.     return 0;
  36. }
  37.